/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package veiw.Panel;

import java.awt.Dimension;
import model.*;
import handler.*;
/**
 *
 * @author markh_000
 */
public class GroupsPanel extends javax.swing.JPanel {

    private ProductGroup productGroup;
    private TicketType ticketType;
    private EventType eventType;
    private Listeners listners;
    private StoreHandler storeHandler;
    

    /**
     * Creates new form Groups
     */
    public GroupsPanel(ProductGroup productGroup, TicketType ticketType, EventType eventType, Listeners listners, StoreHandler storeHandler) {
        this.productGroup = productGroup;
        this.ticketType = ticketType;
        this.eventType = eventType;
        this.listners = listners;
        this.storeHandler = storeHandler;
        int x = 0;
        
        if (productGroup != null) {
            x = 192;
        } else  {
            x = 323;
        }
        setSize(new Dimension(x, 40));

        initComponents();
        setText();
    }

    public void setText() {
        if (productGroup != null) {
            jButton1.setText(productGroup.getGroupType());
        } else if (ticketType != null) {
            jButton1.setText(ticketType.getType());
        } else if (eventType != null) {
            jButton1.setText(eventType.getType());
        }
    }
    
    public void setGroupType(){
        if (productGroup != null) {
            
        } else if (ticketType != null) {
            
        } else if (eventType != null) {
            
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();

        jButton1.setText("jButton1");
        jButton1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
//       setGroupType();
//        ph.setSpecProductList(productGroup);
//        kurvHandler.setTypeView("Product");
    }//GEN-LAST:event_jButton1ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    // End of variables declaration//GEN-END:variables
}
